package tdh.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tdh.dao.DepartDao;
import tdh.entity.po.Depart;
import tdh.entity.vo.DepartVo;
import tdh.service.DepartService;

import java.util.ArrayList;
import java.util.List;

/**
 * 部门信息业务接口实现类
 * @author 曹昊
 * @date 2021/7/12
 */
@Service("departService")
public class DepartServiceImpl implements DepartService {
    //部门信息数据库处理对象
    @Autowired
    DepartDao departDao;

    /*
     * @Author caohao
     * @Description 查询全部部门信息
     * @Date 14:43 2021/7/12
     * @Param []
     * @return java.util.List<tdh.entity.vo.DepartVo>
     **/
    @Override
    public List<DepartVo> allDeaprts() {
        ArrayList<DepartVo> departVos = new ArrayList<DepartVo>();
        for (Depart depart : departDao.allDeaprts()) {
            departVos.add(DepartVo.tsfVo(depart));
        }
        return departVos;
    }

}
